<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<h:body>
	<ui:composition template="/templates/template.xhtml">

		<ui:define name="conteudoPagina">

			<h:form id="formCadEvento">


				<p:fieldset legend="Cadastro de Eventos">
					<p:growl id="growl" showDetail="true"  />
					<h:panelGrid id="grid" columns="3" cellpadding="5"  >
						<p:outputLabel value="Nome do Evento:" />
						<p:inputText id="txtNomeEvento"
							value="#{eventoBean.eventoSelecionado.nome}" size="25"
							required="true" />
						<p:message for="txtNomeEvento" />


						<p:outputLabel value="Tipo:" />
						<p:selectOneMenu id="cboTipos"
							value="#{eventoBean.eventoSelecionado.tipo}" required="true">
							<f:selectItem itemLabel="Escolha um tipo de Evento" />
							<f:selectItems value="#{eventoBean.tipoSelect}" />
						</p:selectOneMenu>
						<p:message for="cboTipos" />

						<p:outputLabel id="txtGenero" value="Genero:" />
						<p:inputText size="25" />
						<p:message for="txtGenero" />

						<p:outputLabel id="txtLocal" value="Local:" />
						<p:inputText value="#{eventoBean.eventoSelecionado.local}"
							size="25" required="true" />
						<p:message for="txtLocal" />

						<p:outputLabel value="Data de Início:" />
						<p:calendar id="calDataInicio"
							value="#{eventoBean.eventoSelecionado.dataInicio}" size="25"
							required="true"></p:calendar>
						<p:message for="calDataInicio" />

						<p:outputLabel value="Data de Término:" />
						<p:calendar id="calDataFinal"
							value="#{eventoBean.eventoSelecionado.dataFinal}" size="25"
							required="true"></p:calendar>
						<p:message for="calDataFinal" />

						<p:outputLabel value="Descrição" />
						<p:inputTextarea id="textArea"
							value="#{eventoBean.eventoSelecionado.descricao}" size="10000"
							required="true" />
						<p:message for="textArea" />

						<p:outputLabel value="Foto" />
						<p:fileUpload id="uplFoto"
							fileUploadListener="#{FileUploadView.handleFileUpload}"
							mode="advanced" dragDropSupport="false" update="growl"
							sizeLimit="100000" fileLimit="3"
							allowTypes="/(\.|\/)(gif|jpe?g|png)$/" required="true" />
						<p:message for="uplFoto" />

					</h:panelGrid>
					<p:commandButton value="Salvar" action="#{eventoBean.salvar}"
						update="growl" icon="ui-icon-disk" />

				</p:fieldset>

			</h:form>




		</ui:define>
	</ui:composition>
</h:body>
</html>